import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘柄华
 * Date: 2022-06-12
 * Time: 20:01
 */
/*
*   数据库连接池
* */
public class Test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            Set<String> set = new HashSet<>();
            int max = 0;
            int n = sc.nextInt();
            while(n>0){
                String id = sc.next();
                String record = sc.next();
                if(record.equals("connect")){
                    set.add(id);
                }else {
                    set.remove(id);
                }
                max = Math.max(max, set.size());
                n--;
            }
            System.out.println(max);
        }
    }
}
